package com.panshi.controller;

import com.panshi.service.IConsultingService;
import com.panshi.tools.Consulting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@ResponseBody
@CrossOrigin
public class ConsultingController {

    @Autowired
    private IConsultingService iConsultingService;

    /***
     * 新增咨询
     * @param consulting
     */
    @RequestMapping("/addConsulting")
    public Map addConsulting (@RequestBody Consulting consulting){
        System.out.println("1  =》addConsulting"+consulting);
        iConsultingService.addConsulting(consulting);
        Map<String ,Object> map = new HashMap<String ,Object>();
        map.put("statis",true);
        map.put("msg","新增成功");
        return map;
    }
}








